Grid1

A = (4.051752859546384, 3.2416860436495)
B = (4.445326143577625, 3.3892760251612155)
d_{AB} = Distance(A, B)
θ: atan(Slope[Line[A, B]])
a = Line(A, B)
m = 4 (slider from -10 to 10, step 1)
n = 3 (slider from -10 to 10, step 1)
PointRelativeToAB: (x(A) + n * d_{AB} * cos(θ) - m * d_{AB} * sin(θ), y(A) + n * d_{AB} * sin(θ) + m * d_{AB} * cos(θ))
b = OrthogonalLine(A, a)
c = OrthogonalLine(PointRelativeToAB, a)
d = OrthogonalLine(PointRelativeToAB, b)
C = Intersect(d, b)
D = Intersect(a, c)
e = Segment(C, PointRelativeToAB)
f = Segment(PointRelativeToAB, D)